package com.alks.function.controller.finance.costcheck;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.entity.PcMtlCheck2;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.dto.PcMtlCheckFinReq;
import com.alks.function.data.dto.SurfaceInMaterialReq;
import com.alks.function.service.stockdept.pcfactorystockquery.IPcMtlCheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@ApiRestController("/mtlCheckFin")
@Api(tags = "面材收货检核")
public class PcMtlCheckFinController {
    @Autowired
    IPcMtlCheckService service;
    //材料入库单号查询
    @PostMapping("/getPcMtlCheckFin")
    @WebLogger
    @ApiOperation(value = "材料入库单号查询")
    public ResponseInfo getPcMtlCheckFin(@RequestBody PcMtlCheckFinReq req) {
        return service.getPcMtlCheckFin(req);
    }

    @GetMapping("/getPcMtlCheckFinDetail")
    @WebLogger
    @ApiOperation(value = "入库明细查询")
    public ResponseInfo getPcMtlCheckFinDetail(@RequestParam String recNo) {
        return service.getPcMtlCheckFinDetail(recNo);
    }

    @GetMapping("/getSdBomFitSub")
    @WebLogger
    @ApiOperation(value = "子材料明细查询")
    public ResponseInfo getSdBomFitSub(@RequestParam String mtlNo){
        return service.getSdBomFitSub(mtlNo);
    }

    @PostMapping("/optionPcMtlCheck")
    @WebLogger
    @ApiOperation(value = "打勾检核")
    public ResponseInfo optionPcMtlCheck(@RequestBody List<PcMtlCheck2> list,@RequestParam @ApiParam(value = "1:打勾记录检核 2：打勾取消检核") String choose){
        return service.optionPcMtlCheck(list,choose);
    }
    //备注确认
    @PostMapping("/clickPcMtlCheck")
    @WebLogger
    @ApiOperation(value = "备注确认")
    public ResponseInfo clickPcMtlCheck(@RequestBody List<PcMtlCheck2> list, @RequestParam @ApiParam(value = "备注") String remark){
        return service.clickPcMtlCheck(list,remark);
    }
    //去单价
    @PostMapping("/getUnitPrice")
    @WebLogger
    @ApiOperation(value = "取单价")
    public ResponseInfo getUnitPrice(@RequestBody List<PcMtlCheck2> list){
        return service.getUnitPrice(list);
    }

    @PostMapping("/savePcMtlCheck")
    @WebLogger
    @ApiOperation(value = "保存")
    public ResponseInfo savePcMtlCheck(@RequestBody List<PcMtlCheck2> list){
        return service.savePcMtlCheck(list);
    }

    @GetMapping("/getDetails")
    @WebLogger
    @ApiOperation("备注信息")
    public ResponseInfo getDetails(){
        return service.getDetails();
    }

    //面材收获检核
    @PostMapping("/getSurfaceMtl")
    @WebLogger
    @ApiOperation("面材收获检核入库明细查询")
    public ResponseInfo getSurfaceMtl(@RequestBody SurfaceInMaterialReq req){
        return service.getSurfaceMtl(req);
    }
}
